#ifndef DASHBOARD_H
#define DASHBOARD_H

#include <QWidget>
#include <QPoint>
#include <QMouseEvent>
#include "math.h"

class DashBoard : public QWidget
{
    Q_OBJECT
public:
    explicit DashBoard(QWidget *parent = nullptr);

protected:
    virtual void paintEvent(QPaintEvent *event);
private:
    void drawDashBoard(QPainter *painter);
    void drawDivideRule(QPainter *painter);
    void drawDishBoardPointer(QPainter *painter);
    void drawDashBoardText(QPainter *painter);
    QPixmap getSignalPixmap(const QColor &color);
private:

    QPoint qCircular;
    int qRadius;
    QColor qDialEdgeColor;
    QColor qDialDivideBackgroudColor;
    int qDialEdgeSize;
    int qDialDivideSize;
    int fMaxDivide = 10;//大等分
    int fMinDivide = 5;
    double BaseAngle = 135.0;//基础角度
    int fMaxValue = 100;
    int qValue = 0;
    int mValue = 0;

    QColor colorDivideRule;
    QColor colorCircle1;
    QColor colorCircle2;
    QColor colorCircle3;
    QColor colorCircle4;
    QColor colorCircle5;
    QColor colorCircle6;
    QColor colorPoniter;
    QColor colorFont;


public slots:
    void slot_ValueChanged(int);
};

#endif // DASHBOARD_H
